package cn.ven.service;

import cn.ven.entity.Hot;
import cn.ven.mapper.HotMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class HotServiceImpl implements HotService{

    @Autowired(required = false)
    HotMapper hotMapper;

    //添加热图
    @Override
    public void addHot(Hot hot) {
        hotMapper.addHot(hot);
    }

    //查找所有的热图
    @Override
    public List<Hot> findAll() {
        return hotMapper.findAll();
    }

    //根据id删除对应的热图
    @Override
    public void delHot(Integer id) {
        hotMapper.delHot(id);
    }

    //根据数量查找对应的热图
    @Override
    public List<Hot> findByType(Integer type, Integer num) {
        List<Hot> hots = hotMapper.findByType(type, num);
        return hots;
    }
}
